<!DOCTYPE html>
<html>
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    
  </style>
</head>
<body>
  
</body>
<script>

  function Parent(msg){
    this.msg = msg;
  }
  Parent.prototype.show = function(){
    console.log(this.msg);
  }

  function Child(msg){
    Parent.call(this, msg);
  }
  // Child.prototype = {
  //   ...Parent.prototype
  // }

  const parent = new Parent();
  for(let i in parent){
    delete parent[i];
  }
  Child.prototype = parent;

  const p = new Parent("admin")
  console.log(p);
  p.show();

  const c = new Child("root");
  console.log(c);
  c.show();
  
</script>
</html>